package com.erp.programmer.bean;

/**
 * @author 杨杨吖
 * @QQ 823208782
 * @WX yjqi12345678
 * @create 2020-09-19 23:14
 */

/**
 * 错误码统一处理类，所有的错误码统一定义在这里
 */
public class CodeMsg {

    private Integer code;//错误码

    private String msg;//错误信息

    /**
     * 构造函数私有化即单例模式
     * 该类负责创建自己的对象，同时确保只有单个对象被创建。这个类提供了一种访问其唯一的对象的方式，可以直接访问，不需要实例化该类的对象。
     * @param code
     * @param msg
     */
    private CodeMsg(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public CodeMsg() {

    }

    public Integer getCode() {
        return code;
    }



    public void setCode(Integer code) {
        this.code = code;
    }



    public String getMsg() {
        return msg;
    }



    public void setMsg(String msg) {
        this.msg = msg;
    }

    //通用错误码定义
    //处理成功消息码
    public static CodeMsg SUCCESS = new CodeMsg(0, "success");
    //通用数据错误码
    public static CodeMsg DATA_ERROR = new CodeMsg(-1, "非法数据！");
    public static CodeMsg VALIDATE_ENTITY_ERROR = new CodeMsg(-2, "");
    public static CodeMsg CAPTCHA_EMPTY = new CodeMsg(-3, "验证码不能为空!");
    public static CodeMsg NO_PERMISSION = new CodeMsg(-4, "您没有当前操作的权限哦！");
    public static CodeMsg CAPTCHA_ERROR = new CodeMsg(-5, "验证码错误！");
    public static CodeMsg USER_SESSION_EXPIRED = new CodeMsg(-6, "还未登录或会话失效，请重新登录！");
    public static CodeMsg PHOTO_EMPTY = new CodeMsg(-7, "上传的图片不能为空！");
    public static CodeMsg PHOTO_SURPASS_MAX_SIZE = new CodeMsg(-8, "上传的图片不能超过1MB！");
    public static CodeMsg PHOTO_FORMAT_NOT_CORRECT = new CodeMsg(-9, "上传的图片格式不正确！");
    public static CodeMsg SAVE_FILE_EXCEPTION = new CodeMsg(-10, "保存文件异常！");
    public static CodeMsg FILE_EXPORT_ERROR = new CodeMsg(-11, "文件导出失败！");
    public static CodeMsg SYSTEM_ERROR = new CodeMsg(-12, "系统出现了错误，请联系管理员！");
    public static CodeMsg EXPORT_EXCEL_ERROR = new CodeMsg(-13, "导出Excel文件失败，请联系管理员！");
    public static CodeMsg CAPTCHA_EXPIRED = new CodeMsg(-14, "验证码已过期，请刷新验证码！");
    public static CodeMsg REQUEST_LIMIT = new CodeMsg(-15, "当前请求被限流，请稍后重试！");
    public static CodeMsg REQUEST_COUNT_MANY = new CodeMsg(-16, "当前请求接口次数过多，请稍后重试！");


    //用户管理类错误码
    public static CodeMsg CONFIRM_PASSWD_EMPTY = new CodeMsg(-1000, "确认密码不能为空！");
    public static CodeMsg USERNAME_EXIST = new CodeMsg(-1001, "用户昵称存在，请换一个！");
    public static CodeMsg USER_PHONE_EXIST = new CodeMsg(-1002, "用户手机号存在，请换一个！");
    public static CodeMsg PASSWD_NOT_MATCH = new CodeMsg(-1003, "密码和确认密码不一致！");
    public static CodeMsg REGISTER_ERROR = new CodeMsg(-1004, "用户注册失败，请联系管理员！");
    public static CodeMsg USER_PREPASSWD_EMPTY = new CodeMsg(-1005, "原密码不能为空！");
    public static CodeMsg USER_NEWPASSWD_EMPTY = new CodeMsg(-1006, "新密码不能为空！");
    public static CodeMsg USER_REPASSWD_EMPTY = new CodeMsg(-1007, "确认新密码不能为空！");
    public static CodeMsg USER_REPASSWD_NOT_EQUAL_NEWPASSWD = new CodeMsg(-1008, "确认新密码和新密码不一致！");
    public static CodeMsg USER_PREPASSWD_NOT_CORRECT = new CodeMsg(-1009, "原密码输入错误！");
    public static CodeMsg USER_PASSWD_EDIT_ERROR = new CodeMsg(-1010, "修改密码失败，请联系管理员！");
    public static CodeMsg USERNAME_EMPTY = new CodeMsg(-1011, "用户昵称不能为空！");
    public static CodeMsg PASSWORD_EMPTY = new CodeMsg(-1012, "用户密码不能为空！");
    public static CodeMsg USERNAME_OR_PASSWD_ERROR = new CodeMsg(-1013, "昵称或密码错误！");
    public static CodeMsg USER_ROLE_EMPTY = new CodeMsg(-1014, "用户所属角色不能为空！");
    public static CodeMsg USER_INFO_EDIT_ERROR = new CodeMsg(-1015, "用户个人信息修改失败，请联系管理员！");
    public static CodeMsg USER_ADD_ERROR = new CodeMsg(-1016, "添加用户信息失败，请联系管理员！");
    public static CodeMsg USER_EDIT_ERROR = new CodeMsg(-1017, "修改用户信息失败，请联系管理员！");
    public static CodeMsg USER_DELETE_ERROR = new CodeMsg(-1018, "删除用户信息失败，请联系管理员！");
    public static CodeMsg REGISTER_USER_ERROR = new CodeMsg(-1019, "注册用户失败，请联系管理员！");
    public static CodeMsg ROLE_NOT_EXIST = new CodeMsg(-1020, "所属角色不存在！");

    //权限管理类错误码
    public static CodeMsg AUTHORITY_NAME_EXIST = new CodeMsg(-2000, "该角色已有该权限，请换一个！");
    public static CodeMsg AUTHORITY_ADD_ERROR = new CodeMsg(-2001, "添加权限信息失败，请联系管理员！");
    public static CodeMsg AUTHORITY_EDIT_ERROR = new CodeMsg(-2002, "修改权限信息失败，请联系管理员！");
    public static CodeMsg AUTHORITY_DELETE_ERROR = new CodeMsg(-2003, "删除权限信息失败，请联系管理员！");
    public static CodeMsg TOKEN_EXPIRED_OR_NOT_EXIST = new CodeMsg(-2004, "token已过期或不存在");

    //种类管理类错误码
    public static CodeMsg CATEGORY_NAME_EXIST = new CodeMsg(-3000, "种类名称重复，请换一个！");
    public static CodeMsg CATEGORY_ADD_ERROR = new CodeMsg(-3001, "添加种类信息失败，请联系管理员！");


    //商品管理错误码
    public static CodeMsg PRODUCT_NOT_EXIST = new CodeMsg(-4000, "商品不存在！");
    public static CodeMsg PRODUCT_ADD_ERROR = new CodeMsg(-4001, "添加商品信息失败，请联系管理员！");
    public static CodeMsg PRODUCT_NUM_ERROR = new CodeMsg(-4002, "商品数量错误，请更换！");

    //订单管理错误码
    public static CodeMsg SUBMIT_ORDER_ERROR = new CodeMsg(-6000, "提交订单失败，请稍后重试！");
    public static CodeMsg ORDER_NOT_EXIST = new CodeMsg(-6001, "该订单已不存在！");
    public static CodeMsg UPDATE_ORDER_COMPLETE_DATE_ERROR = new CodeMsg(-6002, "订单完成时间更新失败！");
    public static CodeMsg ORDER_NOT_PAYED = new CodeMsg(-6003, "该订单还未支付！");
    public static CodeMsg OUT_WAREHOUSE_ERROR = new CodeMsg(-6004, "该订单已生成过出库单！");

    //库存管理错误码
    public static CodeMsg STOCK_DELETE_ERROR = new CodeMsg(-7001, "删除库存单信息失败，请联系管理员！");
    public static CodeMsg STOCK_NOT_EXIST = new CodeMsg(-7002, "库位不存在！");

    //客户公司卖方公司管理错误码
    public static CodeMsg SELLER_COMPANY_NOT_EXIST = new CodeMsg(-8000, "卖方公司不存在！");
    public static CodeMsg CLIENT_COMPANY_NOT_EXIST = new CodeMsg(-8001, "客户公司不存在！");


    //支付管理错误码
    public static CodeMsg CREATE_PAY_ERROR = new CodeMsg(-9000, "创建支付数据失败，请联系管理员！");

    //入仓订单管理错误码
    public static CodeMsg ORDER_INSPECT_STATE_ERROR = new CodeMsg(-10000, "订单验货状态错误，请查证！");
    public static CodeMsg INCOMING_ORDER_ADD_ERROR = new CodeMsg(-10001, "入库单添加错误，请联系管理员！");
    public static CodeMsg PURCHASE_STORAGE_STATE_EDIT_ERROR= new CodeMsg(-10002, "采购单入库状态修改错误，请联系管理员！");
    public static CodeMsg INCOMING_ORDER_HAS_EXIST = new CodeMsg(-10003, "请勿重复生成");

    //入库验货单错误码Incoming
    public static CodeMsg INCOMING_ORDER_NOT_EXIST = new CodeMsg(-10004, "请勿重复生成");

}
